﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using OWC11;
using HZ.MBSM.DBUtility;

public partial class Supervise_GraphList_RepotShowImge : System.Web.UI.Page
{
    int ImgeWith = 900, ImgeHeight = 520;
    protected void Page_Load(object sender, EventArgs e)
    {

        showImage();

    }
    private void showImage()
    {
        
        string[] arrValueNames = SysFun.IsSQL(SysFun.RequestDecrypt(Request.QueryString["id1"].ToString())).Split(',');
        string[] arrPrice = SysFun.IsSQL(SysFun.RequestDecrypt(Request.QueryString["id2"].ToString())).Split(',');
        //string[] arrPrice = { "114.22万", "22万", "333万", "444万", "6666万" };
        //string[] arrValueNames = { "1月", "2月", "3月", "4月", "5月", };
        Class1 dd = new Class1();
        dd.chartTitleValue = "价格统计图";                    // 标题
        dd.chartTypeValue = DDL1.SelectedValue; //显示类型
        dd.chartCategoriesArrValue = arrValueNames;                //显示列

        dd.chartValuesArrValue = arrPrice;                    //列值


        OWC11.ChartSpaceClass oChartSpace = dd.BuildCharts();

        string path = Server.MapPath("" + DDL1.SelectedValue + ".gif");
        oChartSpace.ExportPicture(path, "gif", 800, 500);
        Image1.Height = ImgeHeight;
        Image1.Width =ImgeWith;
        Image1.ImageUrl = "" + DDL1.SelectedValue + ".gif";

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) //比例
    {
        switch (DDL2.SelectedValue)
        {
            case "50":
                ImgeWith = (int)(ImgeWith * 0.5);
                ImgeHeight = (int)(ImgeHeight * 0.5);
                break;
            case "75":
                ImgeWith = (int)(ImgeWith * 0.75);
                ImgeHeight = (int)(ImgeHeight * 0.75);
                break;

            case "100":
              //  ImgeWith = ImgeWith;
              //  ImgeHeight = 798;
                break;
            case "150":
                ImgeWith = (int)(ImgeWith * 1.5);
                ImgeHeight = (int)(ImgeHeight * 1.5);
                break;
            case "200":
                ImgeWith = ImgeWith * 2;
                ImgeHeight = ImgeHeight * 2;
                break;
            case "300":
                ImgeWith = ImgeWith * 3;
                ImgeHeight = ImgeHeight * 3;
                break;

        }
        showImage();
    }
}
